package edu.cs.usask.ca.silver.api.businesslogic;

import java.util.Date;
import java.util.HashMap;
import java.util.UUID;

import edu.cs.usask.ca.silver.api.persistence.StorageI;
import edu.cs.usask.ca.silver.businesslogic.ids.GroupID;
import edu.cs.usask.ca.silver.businesslogic.ids.ModelProjectID;
import edu.cs.usask.ca.silver.businesslogic.ids.UserID;
import edu.cs.usask.ca.silver.definitions.Exposure;

/**
 * This is the interface for the user group. It defines the basic groups
 * 
 * @author Yudi Xue
 */

public interface GroupI {

	public GroupID createGroup(String gName, UserID gOwnerId,
			Exposure gPrivacy, String gDescription, StorageI storage) throws Exception;

	public GroupID[] getAllGroupIDs(StorageI storage) throws Exception;
	
	public String[] getAllGroupNames(StorageI storage) throws Exception;
	
	public HashMap<UUID, String> getAllGroupIDsAndNames(StorageI storage) throws Exception;

	/**
	 * Get all belonging ModelProjects from within the group.
	 * 
	 * @param groupId
	 *            the unique group id
	 * @param storage TODO
	 * @return an array of the modelproject ids
	 * 
	 */
	public ModelProjectID[] getContainedModelProjectIDs(GroupID groupId, StorageI storage)
			throws Exception;

	public String getName(GroupID groupId, StorageI storage) throws Exception;

	public String getPrivacy(GroupID groupId, StorageI storage) throws Exception;

	public UserID getOwnerUserID(GroupID groupId, StorageI storage) throws Exception;

	public String getOwnerUserName(GroupID groupId, StorageI storage) throws Exception;

	public String getDescription(GroupID groupID, StorageI storage) throws Exception;

	// TODO finish the getter and setter, and the rest of the class.

	public Date getCreationDate(GroupID groupID, StorageI storage) throws Exception;

	public Date getCreationTime(GroupID groupID, StorageI storage) throws Exception;

	public boolean setName(GroupID groupID, String newName, StorageI storage) throws Exception;

	public boolean setExposure(GroupID groupID, Exposure newExposure, StorageI storage)
			throws Exception;

	public boolean setOwner(GroupID groupID, UserID userID, StorageI storage) throws Exception;

	public boolean setDescription(GroupID groupID, String description, StorageI storage)
			throws Exception;

	public boolean deleteGroup(GroupID groupID, StorageI storage) throws Exception;

	public boolean addUser(UserID userID, GroupID groupID, StorageI storage) throws Exception;

	public boolean removeUserFromGroup(UserID userID, GroupID groupID, StorageI storage)
			throws Exception;
}
